<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="inc/home::header">
</head>

<link type="text/css" th:href="@{/css/content.css}" rel="stylesheet" />
	<body>
		<!--返回-->
		<div class="back" onclick="location='/index'"><img src="/images/back.png" /></div>
		<div th:include="header :: header"></div>
		<div class="header-title">
			<span>备件管理</span>
		</div>
		<div class="spare-a">
			<div class="spare-al">
				<div style="height:10px"></div>
				<ul>
					<a onclick="loadPage('/Spare/spare')" shiro:hasPermission="sys:spareInventory:spareInventory">
					<li class="active">
						<p>基本信息</p>
					</li>
					</a>
					<a onclick="loadPage('/Spare/storage')" shiro:hasPermission="sys:sparePut:sparePut">
					<li>
						<p>入库</p>
					</li>
					</a>
					<a onclick="loadPage('/Spare/out')" shiro:hasPermission="sys:spareOut:spareOut">
					<li>
						<p>出库</p>
					</li>
					</a>
					<a onclick="loadPage('/Spare/records')" shiro:hasPermission="sys:spareRep:spareRep">
					<li>
						<p>库存</p>
					</li>
					</a>
				</ul>
			</div>
			<div class="spare-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入名称" name="spareName" id="spareName"/></div>
							<div class="spare-ara-alr" onclick="js_method()"></div>
						</div>
						<div class="spare-ara-ar">
							<a onclick="loadPage('/Spare/spare-add','N')" class="spare-tj" shiro:hasPermission="sys:spareInventory:add">添 加</a>
							<a href="#" class="spare-qx" sel="Y" style="display:none" hid='Y' shiro:hasPermission="sys:spareInventory:del">全 选</a>
							<a href="#" class="spare-edit" style="display:none" hid='Y' onclick="loadPageEdit('/Spare/spareEdit')" shiro:hasPermission="sys:spareInventory:edit">编 辑</a>
							<a href="#" class="spare-del" style="display:none" hid='Y' onclick="loadPageDele('/Spare/dele','/Spare/spare')" shiro:hasPermission="sys:spareInventory:del">删 除</a>
						</div>
					</div>
					<div class="srcoll-documentation" id="srcoll-documentation" shiro:hasPermission="sys:spareInventory:view">
					<div class="documentation nottake">
						<ul class="lists" id="lists">
							<!-- <a href="#">
							<li>
								<div class="spare-new clearfix">
									<div class="spare-newl">编号/型号：00001000010000100001</div>
									<div class="spare-newl">序列号：10</div>
								</div>
								<div class="spare-new clearfix">
									<div class="spare-newl">名称：油泵</div>
									<div class="spare-newl">数量：10</div>
								</div>
								<div class="spare-new clearfix">
									<div class="spare-newl">供应商：29所</div>
									<div class="spare-newl">类型：10</div>
								</div>
								<div class="documentation-check"></div>
							</li>
							</a>	 -->						
						</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
		
		
			<!--shiro控制bootstraptable行内按钮看见性 来自的创新方案 -->
	<div>
		<script type="text/javascript">
			var spareInventory = 'hidden';
		</script>
	</div>
	<div shiro:hasPermission="sys:spareInventory:spareInventory">
		<script type="text/javascript">
		spareInventory = '';
		</script>
	</div>
	</body>
	<script th:inline="javascript">
	/*<![CDATA[*/
	 //默认加载   每页显示数据 12              
	$(function() {
		if(spareInventory=="hidden"){
			loadPage('/Spare/storage')
		}else{
			loadDataPage("/Spare/SpareM/spare", "srcoll-documentation", "lists", 12,"spareName");			
		}		
	});
	
	function js_method() {
		$(".dropload-down").remove();
		$('#lists').html("");
		if(spareInventory=="hidden"){
			loadPage('/Spare/storage')
		}else{
			loadDataPage("/Spare/SpareM/spare", "srcoll-documentation", "lists", 12,"spareName");			
		}
	}
	 //构建数据列表
	function dataKk(data, me) {
		var result = '';
		var arrLen = data.length;
		if (arrLen > 0) {
			for (var i = 0; i < arrLen; i++) {
				result += '<a href="#">' + '<li id='+data[i].id+'>'
						+ '<div class="spare-new clearfix">'
						+ '<div class="spare-newl">编号/型号：' + data[i].spareCode+ '</div>' 
						+ '<div class="spare-newl">序列号：' + data[i].spareNo+ '</div>'
						+ '</div>'
						+ '<div class="spare-new clearfix">'
						+ '<div class="spare-newl">名称：' + data[i].spareName+ '</div>' 
						+ '<div class="spare-newl">供应商：' + data[i].spareSupplier+ '</div>' 
						+ '</div>'
						+ '<div class="spare-new clearfix">'						
						+ '<div class="spare-newl">类型：' + data[i].spareType+ '</div>'
						+ '</div>'
						+ '<div class="documentation-check"></div>'
						+ '</li>' + '</a>'
			}
		} else {
			me.lock();
			me.noData();
		}
		return result;
	}
	/*]]>*/
</script>
</html>
